package com.party.core.model.member;

import org.springframework.beans.BeanUtils;

/**
 * 所有统计查询
 * Created by wei.li.
 *
 * @date 2017/12/13 0013
 * @time 11:30
 */
public class MemberMerchantCountQuery extends MemberMerchantCountWithMember {
    private static final long serialVersionUID = 2261353815524967442L;
    //排序
    private Integer sort;

    // 是否查子级数据 1：是 0：否
    private Integer isQueryChild = 1;

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        MemberMerchantCountQuery that = (MemberMerchantCountQuery) o;

        return sort != null ? sort.equals(that.sort) : that.sort == null;

    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (sort != null ? sort.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "MemberMerchantCountQuery{" +
                "sort=" + sort +
                '}';
    }

    public static  MemberMerchantCountQuery transform(MemberMerchantDetailQuery memberMerchantDetailQuery){
        MemberMerchantCountQuery memberMerchantCountQuery = new MemberMerchantCountQuery();
        BeanUtils.copyProperties(memberMerchantDetailQuery, memberMerchantCountQuery);
        return memberMerchantCountQuery;
    }

    public Integer getIsQueryChild() {
        return isQueryChild;
    }

    public void setIsQueryChild(Integer isQueryChild) {
        this.isQueryChild = isQueryChild;
    }
}
